<?php

class ResqueModule extends CWebModule
{
	public $defaultController = 'monitor';
	public function init()
	{
		// this method is called when the module is being created
		// you may place code here to customize the module or the application

		// import the module-level models and components
		$this->setImport(array(
			'resque.models.*',
			'resque.components.*',
		));
	}

    public function getAssetsUrl()
    {
        return Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('application.modules.resque.assets'));
    }

	public function beforeControllerAction($controller, $action)
	{
		if(parent::beforeControllerAction($controller, $action))
		{
			/*
			if ('monitor' == $controller->getId()
			&& ('login' == $action->id || 'default' == $action->id))
            {
                return true;
            }
            else
            {
                if (Constant::$IS_LOGINED == Yii::app()->session['isLogined'])
                {
                    return true;
                }
            }
            */
           return true;
		}
		else
			return false;
	}
}
